﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using SW.YUNCMS.Goods.Dtos;
using Abp.Application.Services;
using Abp.Domain.Repositories;
using SW.YUNCMS.CMS;
using Abp.AutoMapper;

using System.Linq.Dynamic.Core;


using Abp.Authorization;
using Microsoft.EntityFrameworkCore;
using Abp.Collections.Extensions;
using Abp.Application.Services.Dto;
using Abp.IdentityFramework;
using Abp.UI;

namespace SW.YUNCMS.Goods
{
    [AbpAuthorize("Pages.Goods")]
   public  class GoodsAppService:AppService.AppService<GoodsCreateOrUpdateInputDto,CMS.Goods,GoodsInput,GoodsEdit,GoodsOutput,int>
    {//    {  // private readonly IRepository<CMS.Goods> _GoodsRepository;

        public GoodsAppService(IRepository<CMS.Goods> GoodsRepository)
       {
          repository = GoodsRepository;
       }

//        public async Task<List<GoodsOutput>> GetAll()
//        {
//          //  var list = await _GoodsRepository.GetAllListAsync();
//          //  return list.MapTo<List<GoodsOutput>>();
            
//        }
//        public   PagedResultDto<GoodsOutput> GetPaged(GoodsInput input)
//        {
//            //var query = _GoodsRepository.GetAll();

//            query = query.OrderBy(input.Sorting);
//            var totalcount = query.Count();
//            var totallist = query.Page(input.SkipCount,input.MaxResultCount);

//           var dto= totallist.MapTo<List<GoodsOutput>>();

//            return new PagedResultDto<GoodsOutput>(totalcount, dto); 
//        }
    }
}
